<template>
  <div>
    <van-field v-model="smscode" type="text" name="验证码" label="验证码" placeholder="验证码" />
    <van-field v-model="password" type="password" name="密码" label="密码" placeholder="请填写密码"
      :rules="[{ required: true, message: '请填写密码' }]" />
    <van-field v-model="secondword" type="password" name="密码" label="密码" placeholder="请再次确认密码"
      :rules="[{ required: true, message: '请再次确认密码' }]" />
    <div style="margin: 16px;">
      <van-button round block type="info" native-type="submit" @click="submitPass">修改密码</van-button>
    </div>
  </div>
</template>

<script>
import { actionsPassword } from "../api/api";
// 按需引入“vant”
import { Field, Button, NavBar } from "vant";
export default {
  // 按需引入“vant”
  components: {
    [Field.name]: Field,
    [Button.name]: Button,
    [NavBar.name]: NavBar,
  },
  name: "MysetPass",

  data () {
    return {
      smscode: "",
      password: "",
      secondword: "",
    }
  },
  methods: {
    // 提交修改
    submitPass () {
      var obj = {
        mobile: localStorage.getItem("mobile"),
        password: '',
        sms_code: localStorage.getItem("sms_code"),
      }
      actionsPassword(obj).then(res => {
        console.log(res);
      })
    }
  },
}
</script>

<style>
</style>